<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of huser_model
 *
 * @author aquilax
 */
class Huser_model extends Model{

  var $forum_id = 0;

  function loadUser($user_id){
    $select = array(
      'u.id AS user_id',
      'u.username',
      'u.email',
      'UNIX_TIMESTAMP(u.created) AS created',
      'UNIX_TIMESTAMP(uf.last_login) AS last_login',
      'uf.group_id',
      'UNIX_TIMESTAMP(uf.created) AS joined',
    );
    $this->db->select($select);
    $this->db->where('u.id', $user_id);
    $this->db->where('uf.forum_id', $this->forum_id);
    $this->db->join('user_forum uf', 'u.id = uf.user_id');
    $query = $this->db->get('user u', 1);
    return $query->row_array();
  }

}
?>
